import {WeaTools} from 'ecCom';

/**
 * 调用get方法
 *
 * @param path
 * @param params
 */
const get = (path, params) => {
    return WeaTools.callApi('/api/contractmanagement/' + path, 'GET', params);
}


/**
 * 调用post方法
 *
 * @param path
 * @param params
 */
const post = (path, params) => {
    return WeaTools.callApi('/api/contractmanagement/' + path, 'POST', params);
}

/**
 * 获取模板类型列表sessionKey
 * @param params
 */
export const getMouldTypeList = params => {
    return get("getMouldTypeList", params);
}

/**
 * 编辑模板类型
 * @param params
 */
export const editMouldType = params => {
    return post("editMouldType", params);
}

/**
 * 添加模板类型
 * @param params
 */
export const addMouldType = params => {
    return post("addMouldType", params);
}

/**
 * 删除模板类型
 * @param params
 */
export const deleteMouldType = params => {
    return post("deleteMouldType", params);
}

/**
 * 获取模板类型编辑表单
 *
 * @param params
 */
export const getMouldTypeEditForm = params => {
    return get("getMouldTypeEditForm", params);
}

/**
 * 获取模板列表的sessionKey
 *
 * @param params
 */
export const getMouldList = (params) => {
    return get("getMouldList", params);
}

/**
 * 删除模板
 *
 * @param params
 */
export const deleteMould = (params) => {
    return post("deleteMould", params);
}

/**
 * 编辑模板
 *
 * @param params
 */
export const editMould = (params) => {
    return post("editMould", params);
}

/**
 * 添加模板
 *
 * @param params
 */
export const addMould = (params) => {
    return post("addMould", params);
}


/**
 * 获取模板编辑表单
 *
 * @param params
 */
export const getMouldEditForm = (params) => {
    return get("getMouldEditForm", params);
}

/**
 * 获取导入模板文件列表
 *
 * @param params
 */
export const getImportedMouldFileTable = (params) => {
    return get("getImportedMouldFileTable", params);
}

/**
 * 获取合同范本设置流程树
 *
 * @param params
 */
export const getWorkflowTree = (params) => {
    return get("getWorkflowTree", params);
}

/**
 * 获取流程列表的sessionKey
 *
 * @param params
 */
export const getWorkflowList = (params) => {
    return get("getWorkflowList", params);
}

/**
 * 获取新建流程设置的表单数据
 *
 * @param params
 */
export const getAddWorkflowSettingForm = (params) => {
    return get('getAddWorkflowSettingForm', params);
}

/**
 * 添加合同范本流程设置
 *
 * @param params
 */
export const addWorkflowSetting = (params) => {
    return post("addWorkflowSetting", params);
}

/**
 * 校验是否可以添加流程设置
 *
 * @param params
 */
export const checkIfCanAddWorkflowSetting = (params) => {
    return get("checkIfCanAddWorkflowSetting", params);
}

/**
 * 获取流程模板书签匹配表的数据
 *
 * @param params
 */
export const getWorkflowMouldBookmarkMatchingTable = (params) => {
    return get("getWorkflowMouldBookmarkMatchingTable", params);
}

/**
 * 保存流程字段模板书签匹配数据
 *
 * @param param
 */
export const saveBookmarkMatchingDatas = (params) => {
    return post("saveBookmarkMatchingDatas", params);
}

/**
 * 获取基本信息设置表单
 *
 * @param params
 */
export const getBaseInfoSettingForm = (params) => {
    return get("getBaseInfoSettingForm", params);
}

/**
 * 保存基本信息设置数据
 *
 * @param params
 */
export const saveBaseInfoSetting = (params) => {
    return post("saveBaseInfoSetting", params);
}

/**
 * 获取流程模板关系列表
 *
 * @param params
 */
export const getWorkflowMouldRelationalDatas = (params) => {
    return get("getWorkflowMouldRelationalDatas", params);
}

/**
 * 删除流程模板关系
 *
 * @param params
 */
export const deleteWorkflowMouldRelational = (params) => {
    return post("deleteWorkflowMouldRelational", params);
}

/**
 * 保存流程模板关系
 *
 * @param params
 */
export const saveWorkflowMouldRelational = (params) => {
    return post("saveWorkflowMouldRelational", params);
}

/**
 * 获取流程动作设置表
 *
 * @param params
 */
export const getWorkflowActionSettingDatas = (params) => {
    return get("getWorkflowActionSettingDatas", params);
}

/**
 * 删除流程动作设置
 *
 * @param params
 */
export const deleteWorkflowActionSetting = (params) => {
    return post("deleteWorkflowActionSetting", params);
}

/**
 * 保存流程接口动作设置保存流程接口动作设置
 * @param params
 */
export const saveWorkflowActionSetting = (params) => {
    return post("saveWorkflowActionSetting", params);
}

/**
 * 获取模板类型树
 *
 * @param params
 */
export const getMouldTypeTree = (params) => {
    return get("getMouldTypeTree", params);
}

/**
 * 删除流程设置
 *
 * @param params
 */
export const deleteWorkflowSetting = (params) => {
    return post("deleteWorkflowSetting", params);
}

/**
 * 获取多版本信息
 *
 * @param params
 */
export const getWorkflowMultiVersion = (params) => {
    return get("getWorkflowMultiVersion", params);
}

/**
 * 初始化浏览按钮，接口动作等
 *
 * @param params
 */
export const initAll = (params) => {
    return post("initAll", params);
}

/**
 * 获取初始化配置列表的sessionKey
 *
 * @param params
 */
export const getInitConfigList = (params) => {
    return get("getInitConfigList", params);
}

/**
 *保存合同命名规则
 *
 * @param params
 */
export const saveContractNameRules = (params) => {
    return post("saveContractNameRules", params);
}

/**
 * 获取合同名称命名规则
 *
 * @param params
 */
export const getContractNameRules = (params) => {
    return get("getContractNameRules", params);
}

/**
 * 保存模板权限
 *
 * @param params
 */
export const saveMouldPermissions = (params) => {
    return post("saveMouldPermissions", params);
}

/**
 * 获取模板权限数据
 *
 * @param params
 */
export const getMouldPermissionTable = (params) => {
    return get("getMouldPermissionTable", params);
}

/**
 * 检测自定义页面
 *
 * @param params
 */
export const detectCustomPage = (params) => {
    return get("detectCustomPage", params);
}

/**
 * 获取表格匹配相关设置表单
 *
 * @param params
 */
export const getMouldTableMatchingForm = (params) => {
    return get("getMouldTableMatchingForm", params);
}

/**
 * 获取模板表格和流程明细表匹配数据
 *
 * @param params
 */
export const getMouldTableMatchingDatas = (params) => {
    return get("getMouldTableMatchingDatas", params);
}

/**
 * 保存模板表格匹配数据
 *
 * @param params
 */
export const saveMouldTableMatchingDatas = (params) => {
    return post("saveMouldTableMatchingDatas", params);
}

/**
 * 校验流程设置基本信息
 *
 * @param params
 */
export const checkBaseInfoSetting = (params) => {
    return post("checkBaseInfoSetting", params);
}

/**
 *获取新建模板相关参数
 *
 * @param params
 */
export const getImportMouldForm = (params) => {
    return get("getImportMouldForm", params);
}

/**
 * 获取应用基础设置表单
 *
 * @param params
 */
export const getBaseSystemSettingForm = (params) => {
    return get("getBaseSystemSettingForm", params);
}

/**
 * 保存应用基础设置
 *
 * @param params
 */
export const saveBaseSystemSettingForm = (params) => {
    return post("saveBaseSystemSettingForm", params);
}

/**
 * 获取系统设置
 *
 * @param params
 */
export const getSystemSetting = (params) => {
    return get("getSystemSetting", params);
}

/**
 * 同步模板类型到流程表单模板类型字段
 *
 * @param params
 */
export const syncMouldTypeToWorkflowField = (params = {}) => {
    return post("syncMouldTypeToWorkflowField", params);
}